<div class="content">
	<div class="title">
	<h2>近期活动</h2>
	</div>
	<div class="activityblock">
		<h3>各种活动</h3>
		<ul>
		<!-- 静态模板 
		<li><a href="<?php echo $this->baseUrl().'/recentact/detail'?>" id="title" name="title">hehe</a><div class="progressbar"><div class="red" style="width:20%"></div></div><div class="zan">[2012.7.5]好评20%</div></li></li>
		<li><a href="<?php echo $this->baseUrl().'/recentact/detail'?>" id="title" name="title">我是公主，计算机学院系列活动,我是公主，计算机学院系列活动</a><div class="progressbar"><div class="red" style="width:70%"></div></div><div class="zan">[2012.7.5]好评70%</div></li>
		 -->
		<?php
			foreach($this->allacts as $act)
			{
			    $countall = $act['countgood']+$act['countsoso']+$act['countbad'];
			    if($countall==0)$goodrate = 0;
			    else $goodrate = intval(100*$act['countgood'])/$countall;
			    echo '<li><a href="'.$this->baseUrl().'/recentact/detail?actid='.$act['id'].'"';
			    echo ' id="title" name="title">';
			    echo $act['title'];
			    echo '</a><div class="progressbar"><div class="red" style="width:';
			    echo $goodrate.'%">';
			    echo '</div></div><div class="zan">';
			    echo '['.gmdate('Y-m-d',$act['date']+8*3600).']';
			    echo '好评'.$goodrate.'%</div></li>';
			} 
		?>
		
		</ul>
		<div class="page">
		<a href="<?php echo $this->baseUrl().'/recentact/index?page='.'1';?>">首页</a>
		<a href="<?php echo $this->baseUrl().'/recentact/index?page='.($this->page-1);?>">上一页</a>

		<?php
			//echo Zend_Registry::get('config');
			if($this->pagecount<=8)
			{
			    $begin = 1;
			    $end = $this->pagecount;//显示8页
			}
			else 
			{
			    if($this->pagecount-$this->page+1<=8)
			    {
			        $begin = $this->pagecount-7;
			        $end = $this->pagecount;
			    }
			    else 
			    {
			        $begin = $this->page;
			        $end = $this->page + 7;
			    }
			    
			}
			for($i = $begin;$i<=$end;$i++)
			{
			    if($i==$this->page)echo $i;//本页页数没有超链接
			 	else 
			 	{
			 	    echo '<a href="';
			 	    echo $this->baseUrl().'/recentact/index?page='.$i.'"';
			 	    echo '>'.$i.'</a>';
			 	}
			} 
		?>
		<a href="<?php echo $this->baseUrl().'/recentact/index?page='.($this->page+1);?>"> 下一页 </a>  
		<a href="<?php echo $this->baseUrl().'/recentact/index?page='.$this->pagecount;?>">尾页</a>
		</div>
	</div>
	 
</div>